#!/bin/sh
# Script to publish to github pages.
set -e

TMP=${TMP:="/tmp/ocamlunix-gh"}

rm -rf $TMP
git clone `git config --get remote.origin.url` $TMP --reference . 
git -C $TMP checkout --orphan gh-pages
git -C $TMP reset
git -C $TMP clean -dxf
./build
cp LICENSE _build/src/*.{html,css,png,gif} _build/src/ocamlunix.pdf $TMP/
git -C $TMP add .
git -C $TMP commit -m "Update ocamlunix website."
git -C $TMP push origin gh-pages -f 
rm -rf $TMP




